/*=========================================================================

Program:   Virtual Surgery
Language:  C++
Date:      2009-9-1
Version:   0.1
Mail:		   nelfylee@gmail.com

Copyright (c) 2009 Nelfy Lee. All rights reserved.

=========================================================================*/
#include "ControlPanelBase.h"
#include "ControlPanelDock.h"
#include "PipelineModel.h"


ControlPanelBase::ControlPanelBase(QWidget *parent)
: QFrame(parent)
{
	m_parent = static_cast<ControlPanelDock*>(parent);

	m_displayModel = NULL;
	m_pipelineModel = NULL;
}


void ControlPanelBase::setSource(const QModelIndex& index)
{
	m_isource = index;
}


void ControlPanelBase::setDisplayModel(DisplayModel* dm)
{
	m_displayModel = dm;
}


void ControlPanelBase::setPipelineModel(PipelineModel* pm)
{
	m_pipelineModel = pm;
}


Source* ControlPanelBase::currentSource()
{
	if ( m_pipelineModel)
		return m_pipelineModel->sourceFromIndex(m_isource);
	else
		return NULL;
}

PanelType ControlPanelBase::panelType()
{
	return m_panelType;
}